package qf.apollo.mywebview;

import android.content.Context;
import android.os.Build;
import android.webkit.JavascriptInterface;
import android.widget.Toast;

/**
 * Author: zwf(zhaoweifeng@1000phone.com)
 * Date  : 2017-01-09
 * Time  : 15:23
 * Project: gj09
 * Descrite:
 */

public class MyClass {

    private Context context;

    public MyClass(Context context) {
        this.context = context;
    }

    @JavascriptInterface
    public void show(String data){
        Toast.makeText(context, data, Toast.LENGTH_SHORT).show();
    }

    //注意 17必须添加此注解否者调用无效
    @JavascriptInterface
    public  String  getInfo(){

        return  "手机型号:"+ Build.DEVICE+" 手机Api版本:"+Build.VERSION.SDK_INT;
    }


}
